function testKeyCode( evt, intKeyCode ) {
    if ( window.createPopup )
        return evt.keyCode == intKeyCode;
    else
        return evt.which == intKeyCode;
}

function overrideHelpKey( evt )
{
   if ( evt == null )
       evt = event;

   if ( testKeyCode( evt, 112 ) ) //F1
  {
       document.location = '/doc/'; // Go to help redirect page
       cancelKeyEvent( evt ); //don't allow default help popup by F1
       return false;
   }
}


function cancelKeyEvent( evt )
{
   if ( window.createPopup )
       evt.keyCode = 0;
   else
   evt.preventDefault();
}

addEvent(document, 'keydown', overrideHelpKey);